<?php
/**
 * Created by PhpStorm.
 * User: lx
 * Date: 2020/1/7
 * Time: 15:48
 */
namespace app\mtadminapi\model;
use think\Db;
use think\Model;
use think\facade\Request;

class Base extends Model
{
    public function res(){
        $table = self::getTable();
        $data = self::getData();
        $change = self::getChangedData();
        $adminID = cache("adminUser.adminID");
        $ip = ip2long($_SERVER['REMOTE_ADDR']);
        $time = time();
        Db::table()->insert(
            [
                'table' => $table,
                'data' => $data,
                'changeData' => $change,
                'adminID' => $adminID,
                'ip' => $ip,
                'time' => $time,
            ]
        );
    }
}